from cal_time import cal_time
def insert_sort_gap(li,gap):
    for i in range(gap,len(li)):
         temp=li[i]
         j=i-gap
         while j>=0 and li[j]>temp:
             li[j+gap]=li[j]
             j-=gap
         li[j+gap]=temp
@cal_time
def shell_sort(li):
    d=len(li)//2
    while d>=1:
        insert_sort_gap(li,d)
        d//=2
    return li

import random
li=[i for i in range(10000)]
random.shuffle(li)
print(shell_sort(li))